package com.hejjon.service.impl;

import com.fasterxml.jackson.databind.util.JSONPObject;
import com.hejjon.bean.ResponseResult;
import com.hejjon.entity.XUser;
import com.hejjon.repository.IXUserDao;
import com.hejjon.service.IXUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Service;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;

/**
 * Created by CaoShi on 2020/5/21 21:59
 */

@Service
public class XUserService implements IXUserService {

    @Autowired
    private IXUserDao ixUserDao;


    @Override
    public List<XUser> queryAllUser() throws ParseException {

        // DateFormat format = new SimpleDateFormat("yyyy-MM-dd Hh:mm:ss");

        List<XUser> xUserList = ixUserDao.findAll();
//        for (XUser xUser : xUserList) {
//            xUser.setBirthday(format.parse(format.format(xUser.getBirthday())));
//        }
        return xUserList;
    }
}
